package top.goldenyear.porpoise.framework.web.core.model.query;

import java.io.Serializable;
import lombok.Data;

/**
 * 排序字段 DTO
 *
 * @author airhead
 */
@SuppressWarnings("AlibabaClassNamingShouldBeCamel")
@Data
public class QSort implements Serializable {

  /** 顺序 - 升序 */
  public static final String ORDER_ASC = "asc";

  /** 顺序 - 降序 */
  public static final String ORDER_DESC = "desc";

  /** 字段 */
  private String sortName;

  /** 顺序 */
  private String sortMethod = ORDER_DESC;

  /** 空构造方法，解决反序列化 */
  public QSort() {}

  public QSort(String sortName, String sortMethod) {
    this.sortName = sortName;
    this.sortMethod = sortMethod;
  }
}
